﻿using System;
using System.Collections.Generic;
using System.Text;


namespace BubbleSorter
{
    public class EmployeeExe
    {
        public EmployeeExe(string name, decimal salary, int year)//有参构造函数
        {
            Name = name;
            Salary = salary;
            Year = year;
        }

        public string Name { get; }//属性
        public decimal Salary { get; }//属性

        public int Year { get; }
        //public override string ToString() => $"{Name}, {Salary:C}, {Year}岁";//重写方法

        public static string Print(EmployeeExe e) => $"姓名：{e.Name} , 工资：{e.Salary:C}";

        //方法
        //public static bool CompareYear(EmployeeExe y1, EmployeeExe y2) =>
        //  y1.Year < y2.Year;
        public static bool CompareName(EmployeeExe y1, EmployeeExe y2) =>
            y1.Name.CompareTo(y2.Name) < 1 ? true : false;


    }
}
